docs: update memory leak debugging skill#2330
Conversation
237b7f7 to
709080a
Compare
|
Validation refreshed on the current head Local validation: git diff --check origin/main...HEAD
npm run check-format
npm run buildAll pass locally. The current GitHub checks are also green across the visible Node 22/24/26 test matrix on macOS, Ubuntu, and Windows, plus the required format, docs, title, check-changes, and CLA checks. |
709080a to
d36463d
Compare
|
Rebased this branch onto the current Validation on the rebased head: git diff --check origin/main...HEAD
npm run check-format
npm run test -- --test-concurrency=1 --retryAll pass locally. |
d36463d to
7d67c47
Compare
Lightning00Blade
left a comment
There was a problem hiding this comment.
Thanks for the PR!
FYI changed the closes to issue, so we keep it open while we do other changes as well.
| - **Prefer MCP memory tools:** Do NOT attempt to read raw `.heapsnapshot` files directly, as they are extremely large and will consume too many tokens. Use the Chrome DevTools MCP heap snapshot tools to summarize, compare, and inspect snapshots. | ||
| - **Isolate the Leak:** Determine if the leak is in the browser (client-side) or Node.js (server-side). | ||
| - **Common Culprits:** Look for detached DOM nodes, unhandled closures, global variables, event listeners not being removed, and caches growing unbounded. _Note: Detached DOM nodes are sometimes intentional caches; always ask the user before nulling them._ | ||
| - **Close Loaded Snapshots:** Heap snapshots can be large. Use `close_heapsnapshot` after inspecting a file to release memory held by the MCP server. |
There was a problem hiding this comment.
| - **Close Loaded Snapshots:** Heap snapshots can be large. Use `close_heapsnapshot` after inspecting a file to release memory held by the MCP server. | |
| - **Close Loaded Snapshots:** After completing you full investigation use `close_heapsnapshot` to free up memory on the MCP server. |
I think this may be a little bit better as the first one can be interpreted as release after every tool call, which will effectively re-parse a heapsnapshot.
Summary
Issue #2329.
Validation
git diff --check origin/main...HEADnpm run check-format